package com.quotemanager.form;

import org.apache.struts.action.ActionForm;

import com.quotemanager.businessbean.ProductTypeBean;
import com.quotemanager.dataobject.ProductType;

public class ProductTypeMaintenanceForm extends ActionForm {

	private String productTypeId;
	private String productTypeName;
	private String productTypeDescription;
	private String handlerMethod;
	
	private ProductType[] productTypes;
	
	public String getHandlerMethod() {
		return handlerMethod;
	}

	public void setHandlerMethod(String handlerMethod) {
		this.handlerMethod = handlerMethod;
	}

	public String getProductTypeId() {
		return productTypeId;
	}
	
	public void setProductTypeId(String productTypeId) {
		this.productTypeId = productTypeId;
	}
	
	public String getProductTypeName() {
		return productTypeName;
	}
	
	public void setProductTypeName(String productTypeName) {
		this.productTypeName = productTypeName;
	}
	
	public String getProductTypeDescription() {
		return productTypeDescription;
	}
	
	public void setProductTypeDescription(String productTypeDescription) {
		this.productTypeDescription = productTypeDescription;
	}

	public ProductType[] getProductTypes() {
		return productTypes;
	}

	public void setProductTypes(ProductType[] productTypes) {
		this.productTypes = productTypes;
	}
	
	public ProductType getProductType() {
		ProductType productType = new ProductType();
		int prodTypeId = 0;
		try {
			prodTypeId = Integer.parseInt(productTypeId);
		} catch (NumberFormatException e) {
		}
		productType.setProductTypeId(prodTypeId);
		productType.setProductTypeName(this.productTypeName);
		productType.setProductTypeDescription(this.productTypeDescription);
		return productType;
		
	}
	
}
